I'm trying to make a serverless API using workers, and when I run "wrangler dev" in the command line, the local server is made and I am able to go to the page without error. A json object is shown on the page which is what I think I want since it is a "GET" request.
When I run "wrangler publish" and go to the published site, it says "Unexpected token p in JSON at position 0". I've looked at many links and I cannot find how to see what is wrong. In Cloudflare, the the logs show that the GET requests go through.
Does anyone know what I can do next to try and solve this issue? Thank you!
Figured it out, there was an error when I inspect the page, and I used that in combination with console.logs and the cloudflare worker site to fix the problem